package io流;

import date.DateTimeFrtmatter;
import org.junit.Test;

import java.io.FileInputStream;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

public class EE {
    /**
     * 作业1：5个异常
     */
    @Test
    public  void testHomeWork1(){
        //1.IllegalArgumentException异常
        DateTimeFormatter dtf= DateTimeFormatter.ofPattern("null");
        //2.DateTimeException异常
        LocalDateTime c=LocalDateTime.of(2024,10,15,15,4);
       // 3.IOException异常
        FileInputStream  fis=null;
        try {
            fis.read();
            fis=new FileInputStream("fos.txt");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
        }
        //4.NoSuchException异常
        List<String> list=new ArrayList<>();
        Iterator<String> it=list.iterator();
        String next=it.next();
        //5.ClassCastException
        Object o=new Object();
    }
}
